//
//  KStatusIsAdTableViewCell.m
//  Keping
//
//  Created by Joanlove on 2018/6/29.
//  Copyright © 2018年 柯平. All rights reserved.
//

#import "KStatusIsAdTableViewCell.h"

@interface KStatusIsAdTableViewCell()

@property (nonatomic, weak) IBOutlet UILabel *content;
@property (nonatomic, weak) IBOutlet UIImageView *content_imageView;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *content_height_NC;

@end

@implementation KStatusIsAdTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setStatus:(KStatusLayout *)status {
    _status = status;
    self.content.text = status.textLayout.text.string;
    self.content_height_NC.constant = status.textHeight;
    if (status.status.imageUrls.count > 0) {
        NSString *url = status.status.imageUrls[0];
        [self.content_imageView sd_setImageWithURL:[NSURL URLWithString:[KGetImageURL stringByAppendingString:url]] placeholderImage:nil];
    }
    WEAKSELF
    [self.content_imageView setTapActionWithBlock:^{
        //点击图片
        if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(didClickImagesForWebView:)]) {
            [weakSelf.delegate didClickImagesForWebView:weakSelf.status];
        }
    }];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
